﻿Imports Microsoft.VisualBasic

Public Class clsThrowExcrptionError
    Function ThrowError(ByVal strErrException As String, Optional ByVal strParameter As String = "") As String
        Dim strMsgError As String = ""
        Dim strReplaceCode As String = ""
        If Not (strErrException = "") Then
            Try
                Dim strDetailCodeOracle() As String = strErrException.Split(":")
                strReplaceCode = strDetailCodeOracle(0).Replace("-", "")
                strMsgError = Resources.resError.ResourceManager.GetString(strReplaceCode)
                If (strMsgError = Nothing) Then
                    'Resources.resError.ResourceManager.
                    strMsgError = strErrException
                Else
                    If Not (strParameter = "") Then
                        strMsgError = String.Format(strMsgError, strParameter)
                    End If
                End If
            Catch ex As Exception
                strMsgError = Resources.resError.errorMessage
            End Try
        End If



        Return strMsgError
    End Function
End Class
